home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0015 / flicker / putdot.asm < prev    next >
Assembly Source File  |  1997-04-16  |  3KB  |  187 lines

  1.  
  2.     public _cscreen
  3.     public _bitmasks
  4.     public _brush_ix
  5.     public _draw_shifted
  6.  
  7.     ;plot(x, y, color)
  8.     ;    draw just a dot, or brush that's been pre-shifted
  9.     ;    depending if brush_ix is zero
  10.     public    _plot
  11. _plot
  12.     tst.w    _brush_ix
  13.     beq _putdot
  14.     subq.w    #8,4(sp)    ; adjust the "hot spot" to middle of brush
  15.     subq.w    #8,6(sp)    ; adjust the "hot spot" to middle of brush
  16.     jmp    _draw_shifted
  17.  
  18.  
  19.     ;    putdot(x, y, color)
  20.     ;        fast one dot on screen
  21.     public _putdot
  22. _putdot
  23.     move.w    6(sp),d0    ; get y coordinate
  24.     bmi        putdotz
  25.     cmp.w    #200,d0
  26.     bge        putdotz
  27.     move.l    _cscreen,a0
  28.     lsl.w    #5,d0
  29.     adda.w    d0,a0
  30.     lsl.w    #2,d0
  31.     adda.w    d0,a0    ; effectively multiply y coordinate by 160 = 128+32
  32.     move.w    4(sp),d0    ; get x coordinate
  33.     bmi        putdotz
  34.     cmp.w    #320,d0
  35.     bge        putdotz
  36.     move.w    d0,d1
  37.     and.w    #$fff0,d1    
  38.     lsr.w    #1,d1
  39.     adda    d1,a0    ; point a0 to the right word even ... 
  40.     move.l    #_bitmasks,a1
  41.     and.w    #$000f,d0    ; find place in word
  42.     lsl.w    #1,d0        ; convert to word index
  43.     move.w    0(a1,d0.w),d0    ;  now have mask in word
  44.     move.w    8(sp),d1    ; get color parameter
  45.     lsl.w    #2,d1        ; convert to pointer value
  46.     move.l    #dots,a1
  47.     move.l    0(a1,d1.w),a1    ; get rest of routine for this color
  48.     jmp        (a1)
  49. putdotz    rts
  50.  
  51. dot0:    
  52.     not.w    d0
  53.     and.w    d0,(a0)+
  54.     and.w    d0,(a0)+
  55.     and.w    d0,(a0)+
  56.     and.w    d0,(a0)+
  57.     rts
  58.  
  59. dot1: 
  60.     or.w    d0,(a0)+
  61.     not.w    d0
  62.     and.w    d0,(a0)+
  63.     and.w    d0,(a0)+
  64.     and.w    d0,(a0)+
  65.     rts
  66.  
  67. dot2: 
  68.     or.w    d0,2(a0)
  69.     not.w    d0
  70.     and.w    d0,(a0)
  71.     and.w    d0,4(a0)
  72.     and.w    d0,6(a0)
  73.     rts
  74.  
  75. dot3:
  76.     or.w    d0,(a0)+
  77.     or.w    d0,(a0)+
  78.     not.w    d0
  79.     and.w    d0,(a0)+
  80.     and.w    d0,(a0)+
  81.     rts
  82.  
  83. dot4:
  84.     or.w    d0,4(a0)
  85.     not.w    d0
  86.     and.w    d0,(a0)+
  87.     and.w    d0,(a0)
  88.     addq    #4,a0
  89.     and.w    d0,(a0)
  90.     rts
  91.  
  92. dot5:
  93.     or.w    d0,(a0)
  94.     or.w    d0,4(a0)
  95.     not.w    d0
  96.     and.w    d0,2(a0)
  97.     and.w    d0,6(a0)
  98.     rts
  99.  
  100. dot6:
  101.     or.w    d0,2(a0)
  102.     or.w    d0,4(a0)
  103.     not.w    d0
  104.     and.w    d0,(a0)
  105.     and.w    d0,6(a0)
  106.     rts
  107.  
  108. dot7:
  109.     or.w    d0,(a0)+
  110.     or.w    d0,(a0)+
  111.     or.w    d0,(a0)+
  112.     not.w    d0
  113.     and.w    d0,(a0)+
  114.     rts
  115.  
  116. dot8:    
  117.     not.w    d0
  118.     and.w    d0,(a0)+
  119.     and.w    d0,(a0)+
  120.     and.w    d0,(a0)+
  121.     not.w    d0
  122.     or.w    d0,(a0)
  123.     rts
  124.  
  125. dot9: 
  126.     or.w    d0,(a0)+
  127.     or.w    d0,4(a0)
  128.     not.w    d0
  129.     and.w    d0,(a0)+
  130.     and.w    d0,(a0)
  131.     rts
  132.  
  133. dota: 
  134.     or.w    d0,2(a0)
  135.     or.w    d0,6(a0)
  136.     not.w    d0
  137.     and.w    d0,(a0)
  138.     and.w    d0,4(a0)
  139.     rts
  140.  
  141. dotb:
  142.     or.w    d0,(a0)+
  143.     or.w    d0,(a0)+
  144.     or.w    d0,2(a0)
  145.     not.w    d0
  146.     and.w    d0,(a0)
  147.     rts
  148.  
  149. dotc:
  150.     not.w    d0
  151.     and.w    d0,(a0)+
  152.     and.w    d0,(a0)+
  153.     not.w    d0
  154.     or.w    d0,(a0)+
  155.     or.w    d0,(a0)
  156.     rts
  157.  
  158. dotd:
  159.     or.w    d0,(a0)
  160.     or.w    d0,4(a0)
  161.     or.w    d0,6(a0)
  162.     not.w    d0
  163.     and.w    d0,2(a0)
  164.     rts
  165.  
  166. dote:
  167.     or.w    d0,2(a0)
  168.     or.w    d0,4(a0)
  169.     or.w    d0,6(a0)
  170.     not.w    d0
  171.     and.w    d0,(a0)
  172.     rts
  173.  
  174. dotf:
  175.     or.w    d0,(a0)+
  176.     or.w    d0,(a0)+
  177.     or.w    d0,(a0)+
  178.     or.w    d0,(a0)
  179.     rts
  180.  
  181.  
  182.     dseg
  183. dots dc.l     dot0,dot1,dot2,dot3,dot4,dot5,dot6,dot7
  184.     dc.l    dot8,dot9,dota,dotb,dotc,dotd,dote,dotf
  185.  
  186.  
  187.